package demo19;

import java.io.*;

public class demo19_1 {
    public static void main(String[] args) throws Exception {
        InputStream is = new FileInputStream("src\\main\\java\\demo19\\a.txt");
        OutputStream os = new FileOutputStream("src\\main\\java\\demo19\\b.txt", true);
        byte[] bytes = new byte[1024];
        int len;
        while((len = is.read(bytes)) != -1){
            os.write(bytes, 0, 22);
            os.write("\r\n".getBytes());
            String rs = new String(bytes, 0, len);
            System.out.println(rs);

        }
        is.close();
    }
}
